﻿<ad:DockableContent x:Class="XmlExplorer.ExpressionsDockableContent"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
             xmlns:local="clr-namespace:XmlExplorer"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <DataGrid ItemsSource="{Binding}" MouseDoubleClick="DataGrid_MouseDoubleClick"
                  AutoGenerateColumns="False" HeadersVisibility="Column" GridLinesVisibility="None">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Expression" Binding="{Binding Expression}" Width="auto" />
                <DataGridTextColumn Header="Name" Binding="{Binding Name}" Width="auto" />
                <DataGridTemplateColumn Width="auto" CanUserResize="False" CanUserSort="False">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="/XmlExplorer;component/Resources/Search16.png" 
                                   ToolTip="Select the first node that matches this XPath expression."
                                   Stretch="None" RenderOptions.BitmapScalingMode="NearestNeighbor" 
                                   Cursor="Hand" MouseUp="OnSelectImageMouseUp" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Width="auto" CanUserResize="False" CanUserSort="False">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="/XmlExplorer;component/Resources/Launch16.png" 
                                   ToolTip="Launch the complete result of this XPath expression in a new tab."
                                   Stretch="None" RenderOptions.BitmapScalingMode="NearestNeighbor" 
                                   Cursor="Hand" MouseUp="OnLaunchImageMouseUp" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
                <DataGridTemplateColumn Width="auto" CanUserResize="False" CanUserSort="False">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="/XmlExplorer;component/Resources/Exit10.png" 
                                   ToolTip="Delete this XPath expression."
                                   Stretch="None" RenderOptions.BitmapScalingMode="NearestNeighbor" 
                                   Cursor="Hand" MouseUp="OnDeleteImageMouseUp" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</ad:DockableContent>
